package com.xlh.server.protocol.support.json;

import android.text.Html;
import android.view.View;
import android.widget.TextView;

import com.xlh.Utils.FontHandler;
import com.xlh.Utils.GsonManager;
import com.xlh.bean.ProtocolObject.Base;
import com.xlh.bean.ProtocolObject.Exits;
import com.xlh.bean.ProtocolObject.ParamObject.LabelParam;
import com.xlh.bean.TitleBean;
import com.xlh.interf.IActivity;
import com.xlh.interf.ITakeMessage;

import java.util.List;

/**
 * 退出 关闭APP
 * Created by Administrator on 2018/7/2.
 */

public class SysExitServer implements ITakeMessage {

    private IActivity atv;
    private String hasType = "sysExit";
    private Base protccoObj;
    public SysExitServer(IActivity atv){
        this.atv = atv;
    }

    @Override
    public void takeMessage(String t,String s){

        if(!t.equals(this.hasType)) return;

        protccoObj =  GsonManager.gsmgr.jsonToAnyObject(s, Base.class);

        if(protccoObj==null) return;
        this.atv.getActivity().finish();
        this.atv.getActivity().mSocketClient.stop();
        this.atv.getActivity().mSocketClient = null;


    }

    @Override
    public boolean takeMessage(String s) {
        return false;
    }

    @Override
    public void init() {

    }

    @Override
    public void atViewLoadAfterInit() {

    }






}
